package com.myproject.thread.interrupt;

import java.util.concurrent.locks.LockSupport;

public class IsInterruptLocksupport1 implements Runnable {

    @Override
    public void run() {


        LockSupport.park();
        /*for (int i = 0; i < 1000000; i++) {

            for (int j = 0; j < 1000000; j++) {

                for (int k = 0; k < 10; k++) {

                }
            }
        }*/
        /*try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
        //System.out.println(Thread.currentThread().getName()+" interrput "+Thread.currentThread().isInterrupted());


    }

    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(new IsInterruptLocksupport1());
        thread.start();

        Thread.sleep(1000);


        thread.interrupt();
        System.out.println("thread t1 "+thread.isInterrupted());


        Thread.sleep(1000);
        System.out.println("thread t1 "+thread.isInterrupted());
        Thread thread1 = new Thread(() -> {

        });

    }
}
